﻿using ESC.Actions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Services;
using System.Web.Services.Protocols;

namespace ESCUtils
{
    public class PermissionAttribute : SoapExtension
    {
        public override object GetInitializer(LogicalMethodInfo methodInfo, SoapExtensionAttribute attribute)
        {
            return null;
        }

        public override object GetInitializer(Type serviceType)
        {
            return null;
        }

        public override void Initialize(object initializer)
        {
            //return null;
        }

        public override void ProcessMessage(SoapMessage message)
        {
            //throw new NotImplementedException();

            if (!DES.PermissionCheck())
            {
                throw new Exception("主机未注册！");
            }
        }
    }
}
